#ifndef __APP_H_
#define __APP_H_

#ifdef __cplusplus
extern "C" {
#endif

#include <common.h>

#define MAX_APP_NUM     64

typedef enum E_APP_PRI
{
    E_APP_PRI0 = 240,
    E_APP_PRI1 = 241,
    E_APP_PRI2 = 242,
    E_APP_PRI3 = 243,
    E_APP_PRI4 = 244,
    E_APP_PRI5 = 245,
    E_APP_PRI6 = 246,
    E_APP_PRI7 = 247,
    E_APP_PRI8 = 248,
    E_APP_PRI9 = 249,
    E_APP_PRI10 = 250,
    E_APP_PRI11 = 251,
    E_APP_PRI12 = 252,
    E_APP_PRI13 = 253,
    E_APP_PRI14 = 254,
    E_APP_PRI15 = 255,
} E_APP_PRI;

typedef void (*APP_FUNC)(void);

typedef struct APP_INFO
{
    APP_FUNC    pfunc;
    U08*        stackAddr;
    U16         stackSize;
    U08*        name;
    E_APP_PRI   priority;
} APP_INFO;

E_RET AppRegister(APP_FUNC pFunc, U08* stackAddr, U16 stackSize, U08* name, E_APP_PRI priority);

#ifdef __cplusplus
}
#endif

#endif

